<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>{block name="title"}管理中心{/block}</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
    <link rel="stylesheet" href="/static/admin/bower_components/bootstrap/dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="/static/admin/bower_components/font-awesome/css/font-awesome.min.css" />
    <link rel="stylesheet" href="/static/admin/bower_components/Ionicons/css/ionicons.min.css" />
    <link rel="stylesheet" href="/static/admin/dist/css/AdminLTE.min.css" />
    <link rel="stylesheet" href="/static/admin/dist/css/skins/skin-blue.min.css" />
    <link rel="stylesheet" href="/static/admin/plugins/pace/pace.min.css" />
    <style>
        ::-webkit-scrollbar
        {
            width: 5px;
        }
        /* 垂直滚动条的滑动块 */
        ::-webkit-scrollbar-thumb:vertical {
            border-radius: 4px;
            -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);
            background-color:rgba(129,129,129,0.5);
        }
    </style>

    <!--[if lt IE 9]>
    <script src="/static/admin/html5shiv.min.js"></script>
    <script src="/static/admin/respond.min.js"></script>

    <![endif]-->
    {block name="style"}{/block}
</head>

<!--

AdminLte 官网： https://github.com/almasaeed2010/AdminLTE

 -->

<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper fixed">
    <!-- 顶部 -->
    <header class="main-header">
        <!-- Logo -->
        <a href="/admin/index/index.html" class="logo">
            <span class="logo-mini">后台</span>
            <span class="logo-lg">管理中心</span>
        </a>
        <!-- Header Navbar -->
        <nav class="navbar navbar-static-top" role="navigation">
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                <span class="sr-only">切换导航</span>
            </a>
            <!-- Navbar Right Menu -->
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <!-- 用户信息 -->
                    <li class="dropdown user user-menu">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <img src="/static/admin/dist/img/user12-160x160.jpg" class="user-image" alt="User Image">
                            <span class="hidden-xs">员工昵称</span>
                        </a>
                        <ul class="dropdown-menu">
                            <!-- The user image in the menu -->
                            <li class="user-header">
                                <img src="/static/admin/dist/img/user12-160x160.jpg" class="img-circle" alt="User Image">
                                <p>员工昵称 - 职位<small>描述信息</small></p>
                            </li>
                            <!-- Menu Footer-->
                            <li class="user-footer">
                                <div class="pull-left">
                                    <a href="#" class="btn btn-default btn-flat">个人资料</a>
                                </div>
                                <div class="pull-right">
                                    <a href="javascript:;" onclick="loginout()"  class="btn btn-default btn-flat">退出后台</a>
                                </div>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </nav>
    </header>

    <!-- 左边 -->
    <aside class="main-sidebar" id="index_app">
        <section class="sidebar">
            <div class="user-panel">
                <div class="pull-left image">
                    <img src="/static/admin/dist/img/user12-160x160.jpg" class="img-circle" alt="User Image">
                </div>
                <div class="pull-left info">
                    <p>员工昵称</p>
                    <a href="#"><i class="fa fa-circle text-success"></i> 当前在线</a>
                </div>
            </div>
            <!-- 菜单 -->
            <ul class="sidebar-menu" data-widget="tree">
                <li class="header">功能菜单</li>

              <!--<li class="active" ><a  href="javascript:;"><i class="fa fa-circle"></i> <span>首页</span></a></li>-->
                <li v-for="module in modules" class="treeview">
                    <a>
                        <i class="fa fa-circle-o"></i>
                        <span>{{module.name}}</span>
                        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li v-for="node in module.nodes"><a v-bind:href="url_admin+'/'+node.path"><i class="fa fa-circle"></i> <span>{{node.name}}</span></a></li>
                    </ul>
                </li>

            </ul>
        </section>
    </aside>

    <!-- 正文 -->
    <div class="content-wrapper">
        <section class="content-header">
            <h1>{block name="name"}模块名称{/block}<small>{block name="desc"}描述信息{/block}</small></h1>
        </section>
        <section class="content-message" style="padding:15px 15px 0 15px;">

        </section>
        <section class="content container-fluid">{block name="content"}写点什么？{/block}</section>
    </div>

    <!-- 底部 -->
    <footer class="main-footer">
        <strong>Copyright &copy; 2017 <a href="#">网络科技</a>.</strong> All rights reserved.
    </footer>
</div>

<!-- 脚本 -->
<script src="/static/admin/jquery.1.12.4.min.js"></script>
<script type="text/javascript">

// 菜单选择
var active_menu = '{block name="menu"}'+location.pathname+'{/block}';
 var domain = "{:config('api_url')}";
// ajax
var post = function (url, data, callback) {
    $.post(domain + url, data, callback);
}


jQuery.ajaxSetup({


    headers: { // 默认添加请求头
        "Authorize": localStorage.getItem('sup_staff_token')+","+location.pathname,

    }

});

function loginout(){

    jQuery.post(url+'/rbac/loginOut',function(res) {
        if(res.code==200){
            location.href='/admin/index/login';
            localStorage.removeItem('sup_staff_token');
        }else{
            layer.alert('系统忙');
        }
    });

}

var url = domain;


//var url = "http://sup.com";


// 字符串函数
if (!String.prototype.repeat) {
    String.prototype.repeat = function (num) {
        if (num <= 1) {
            return this;
        } else {
            var temp = '';
            for(var i = 0;i < num;i++) {
                temp += this;
            }
            return temp;
        }
    }
}
</script>
{block name="script_before"}{/block}
<script src="/static/admin/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="/static/admin/bower_components/PACE/pace.min.js"></script>
<script src="/static/admin/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<script src="/static/admin/bower_components/fastclick/lib/fastclick.js"></script>
<script src="/static/admin/dist/js/adminlte.min.js"></script>
<script type="text/javascript" src="/static/admin/global.js"></script>
<script type="text/javascript" src="/static/admin/vue.js"></script>

<script type="text/javascript">


    var index_vm = new Vue({

        el:'#index_app',
        data:{
            modules:[],
            url_admin : 'http://'+location.hostname + (location.port ? ':' + location.port : '')
        },
        created:function(){
            this.getData();
        },
        methods:{
            getData :function (){
                this.modules=[
                    {name:'用户管理',nodes:[{'name':'用户列表','path':'xx/xx'}]}
                ];

              /*  jQuery.get(url+'/rbac/checkLogin',function(res) {
                    if(res.code!=200){
                        location.href="/admin/index/login.html";
                        return;
                     }
                });*/

               /* jQuery.get('http://sup.com/rbac/getAllNodes',function(res) {

                    index_vm.modules = res.data;
                    setTimeout(function(){
                        jQuery(".wrapper .main-sidebar .sidebar-menu .active").removeClass('active');
                        jQuery(".wrapper .main-sidebar .sidebar-menu").find('a[href="http://'+location.hostname + location.pathname + (location.port ? ':' + location.port : '')+ '"]').parents('li').addClass('active');
                        jQuery(".wrapper .main-sidebar .sidebar-menu").find('a[href="http://'+location.hostname + location.pathname + (location.port ? ':' + location.port : '')+'"]').parents('.treeview').addClass('menu-open');

                    }, 20);
                });*/
            },
        }

    });




</script>

{block name="script"}{/block}
</body>
</html>